package com.dingup.provider.service.sys;

import com.dingup.api.model.sys.SysPermission;
import com.dingup.api.model.sys.SysPermissionGroup;
import com.dingup.provider.model.sys.UpdateRolePermission;

import java.util.List;
import java.util.Map;

/**
 * Created by wancheng on 2018/7/28.
 */
public interface SysPermissionService {

    public List<SysPermissionGroup> getAll();

    public List<SysPermissionGroup> getRolePermissionGroupByRoleId(Integer roleId);

    public List<SysPermissionGroup> getRolePermissionGroupByUserId(String userId);

    /**
     * 获取用户的权限，精确到url
     * @param userId
     * @return
     */
    public List<SysPermission> getRolePermissionByUserId(String userId);

    public List<SysPermissionGroup> getRoleHasPermissionGroupTreeByRoleId(Integer roleId);

    /**
     * 根据当前登陆用户 获取操作的权限输
     * @param roleId
     * @param userId
     * @return
     */
    public List<SysPermissionGroup> getRoleHasPermissionGroupTreeByRoleIdAndUserId(Integer roleId,String userId);

    public Map<String,Boolean> getRoleHasPermissionGroupTreeByUserId(String userId);

    public Boolean deleteRolePermission(Integer roleId);

    public Boolean updateRolePermission(Integer roleId, List<UpdateRolePermission> list);

    /**
     * 获取所有的url权限
     * @return
     */
    public List<SysPermission> getAllPermission();

    public List<String> getPermissionByUserId(String userId);

}
